package com.jinbiao.dao.config;

import org.mybatis.spring.annotation.MapperScan;
import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Configuration;

/**
 * 扫包配置加载
 * @author EX_WLJR_ZHUANGJB
 *	
 */

@Configuration 				
@MapperScan("com.jinbiao.dao.mapper") //扫描dao。mapper包下的类
@AutoConfigureAfter(MybatiesConfig.class) //自动加载MybatiesConfig。class 类
public class MybatiesScannerConfig {
	
	 public MapperScannerConfigurer mapperScannerConfigurer(){
	        MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
	        mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory");
	        mapperScannerConfigurer.setBasePackage("com.jinbiao.dao.mapper");
	        return mapperScannerConfigurer;
	        
	    }

}
